﻿
Imports std

Public Class function_call
    Inherits function_call_base(Of parameters_list)
    Implements iInvokeableWithOutput

    Private Sub New(ByVal name As String, ByVal iparameters As parameters_list)
        MyBase.New(name, iparameters)
    End Sub

    Protected Shared Function create(ByVal name As String,
                                     ByVal parameters As parameters_list) As function_call_base(Of parameters_list)
        Return New function_call(name, parameters)
    End Function

    Protected Shared Function parseImpl(ByVal input As String, ByRef index As Int64, _
                                        ByRef output As function_call) As Boolean
        Return function_call_base(Of parameters_list)._parse(input, index, output,
                                                             AddressOf parameters_list.parse, AddressOf create)
    End Function

    Public Shared Shadows Function parse(ByVal input As String, ByRef index As Int64, _
                                         ByRef output As function_call) As Boolean
        Return parsebase(input, index, output, AddressOf parseImpl)
    End Function
End Class
